---
sidebar_label: Bedrock
---

# BedrockChat

> [Amazon Bedrock](https://aws.amazon.com/bedrock/) is a fully managed service that makes Foundation Models (FMs)
> from leading AI startups and Amazon available via an API. You can choose from a wide range of FMs to find the model that is best suited for your use case.

## Setup

You'll need to install the `@langchain/community` package:

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/community
```

Then, you'll need to install a few official AWS packages as peer dependencies:

```bash npm2yarn
npm install @aws-crypto/sha256-js @aws-sdk/credential-provider-node @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```

You can also use BedrockChat in web environments such as Edge functions or Cloudflare Workers by omitting the `@aws-sdk/credential-provider-node` dependency
and using the `web` entrypoint:

```bash npm2yarn
npm install @aws-crypto/sha256-js @smithy/protocol-http @smithy/signature-v4 @smithy/eventstream-codec @smithy/util-utf8 @aws-sdk/types
```

## Usage

Currently, only Anthropic and Cohere models are supported with the chat model integration. For foundation models from AI21 or Amazon, see [the text generation Bedrock variant](/docs/integrations/llms/bedrock).

import CodeBlock from "@theme/CodeBlock";
import BedrockExample from "@examples/models/chat/integration_bedrock.ts";

<CodeBlock language="typescript">{BedrockExample}</CodeBlock>

## Multimodal inputs

:::tip
Multimodal inputs are currently only supported by Anthropic Claude-3 models.
:::

Anthropic Claude-3 models hosted on Bedrock have multimodal capabilities and can reason about images. Here's an example:

import BedrockMultimodalExample from "@examples/models/chat/integration_bedrock_multimodal.ts";

<CodeBlock language="typescript">{BedrockMultimodalExample}</CodeBlock>
